package com.myproject.proxy.cglib;

import net.sf.cglib.proxy.Enhancer;

public class CGlibProxyTest {

    public static void main(String[] args) {

        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(Teacher.class);
        enhancer.setCallback(new SubjectMethodInterceptor());

        Teacher teacher = (Teacher) enhancer.create();
        teacher.teach();
        System.out.println(teacher.getClass());
        System.out.println(teacher.getClass().getClassLoader());

    }

}
